//
// Created by daybeha on 23-11-21.
//

#ifndef IMAGE_TRANSPORT_TUTORIALS_IMAGE_NODE_H
#define IMAGE_TRANSPORT_TUTORIALS_IMAGE_NODE_H

#include <iostream>


#include "rclcpp/rclcpp.hpp"
#include "sensor_msgs/msg/image.hpp"
#include "sensor_msgs/msg/compressed_image.hpp"
#include "sensor_msgs/msg/camera_info.hpp"
#include <image_transport/image_transport.hpp>
#include <cv_bridge/cv_bridge.h>

#include <opencv2/opencv.hpp>

using namespace std;

class image_node : public rclcpp::Node {
public:
    image_node();

    sensor_msgs::msg::CompressedImage cv_to_ros(cv::Mat &image, std_msgs::msg::Header &header);


private:
    void imageLCallback(const sensor_msgs::msg::Image::ConstSharedPtr &msg);
    void imageRCallback(const sensor_msgs::msg::Image::ConstSharedPtr &msg);

    image_transport::Publisher pub_l, pub_r;
    image_transport::Subscriber sub_l, sub_r;
    string format= "bgr8";

//    sensor_msgs::msg::CompressedImage com_img_l, com_img_r;


    // kitti param
};
#endif //IMAGE_TRANSPORT_TUTORIALS_IMAGE_NODE_H
